/**
 * Created by DukeCrushIt on 2015/7/7.
 */
//module game{
    class PhaseVo{
        public index:number;
        public fx:number;//from coor
        public fy:number;
        public ty:number;
        public tx:number;//target coor
        public fa:number;//alpha
        public ta:number;
        public fscl:number;//scale
        public tscl:number;
        public frameCnt:number;
        public type:string;
        public constructor(){
        }

        public parse(obj:Object){
            this.index = obj["id"];
            this.fx = obj["fx"];
            this.fy = obj["fy"];
            this.tx = obj["tx"];
            this.ty = obj["ty"];
            this.fa = obj["fa"];
            this.ta = obj["ta"];
            this.fscl = obj["fscl"];
            this.tscl = obj["tscl"];
            this.frameCnt = obj["frames"];
        }

        public initDis(dis:egret.DisplayObject){
            dis.x = this.fx;
            dis.y = this.fy;
            dis.alpha = this.fa;
            dis.scaleX = dis.scaleY = this.fscl;
        }

        public getTweenProps():Object{
            var prop:Object = {};
            if( this.fx != this.tx)
                prop["x"]=this.tx;
            if( this.fy != this.ty)
                prop["y"]=this.ty;
            if( this.fa != this.ta)
                prop["alpha"]=this.ta;
            if( this.fscl != this.tscl)
                prop["scaleX"]=prop["scaleY"]=this.tscl;

            return prop;
        }

        public currentFrame:number;
    }
//}